package com.itheima.homework.Set接口;

import java.util.Collections;
import java.util.HashSet;

public class Test {
    public static void main(String[] args) {
        HashSet<Student> set=new HashSet<>();
        Student s=new Student("张三","男",20);
        Student s1=new Student("李四","女",21);
        Student s2=new Student("张三","男",20);

        Collections.addAll(set,s,s1,s2);
        for (Student student : set) {
            System.out.println(student.toString());
        }
    }
}
